doctype 5
html
  head
    title= title
    link(rel='stylesheet', href="/css/bootstrap.min.css")
    link(rel='stylesheet', href="/font-awesome/css/font-awesome.css")
    link(rel='stylesheet', href="/css/animate.css")

    block css

    link(rel='stylesheet', href="/css/style.css")

  body

    div(id='wrapper')
        nav(class='navbar-default navbar-static-side', role='navigation')
            div(class='sidebar-collapse')
                ul(class='nav metismenu', id='side-menu')
                    li(class='nav-header')
                        div(class='dropdown profile-element')
                            span
                                img(alt="image",class="img-circle",src="/img/profile_small.jpg")
                            a(data-toggle="dropdown", class="dropdown-toggle", href="#")
                                span(class="clear") 
                                    span(class="block m-t-xs") 
                                        strong(class="font-bold") Genshui Yang
                             
                                span(class="text-muted text-xs block") Art Programmer
                                    b(class="caret")
                            ul(class="dropdown-menu animated fadeInRight m-t-xs")
                                li
                                    a(href='profile.html') 个人中心
                                li
                                    a(href='contacts.html') 通讯录
                                li
                                    a(href='mailbox.html') 设置
                                li(class='divider')
                                li
                                    a(href='/login') Logout

                        div(class="logo-element") NE+

                    li(style="display:none")
                        a(href='/')
                            i(class="fa fa-wrench")
                            span(class="nav-label") 工具 
                            span(class="fa arrow")
                        ul(class="nav nav-second-level collapse")
                            li
                                a(href='/CodeGenerator') 代码生成器-Model
                            li
                                a(href='/Doc') 数据库表结构

        div(id='page-wrapper', class='gray-bg')
            div(class='row border-bottom')  
                nav(class="navbar navbar-static-top", role="navigation", style="margin-bottom: 0")
                    div.navbar-header
                        a(class="navbar-minimalize minimalize-styl-2 btn btn-primary", href="#")
                            i(class='fa fa-bars')

                    ul(class="nav navbar-top-links navbar-right")
                        li
                            span(class="m-r-sm text-muted welcome-message") Welcome to NOKE ERP.
                        li
                            a(href='/login')
                                i(class="fa fa-sign-out") Log out

            div(class="row white-bg")
                // 面包屑 bread crumb
                block crumb

            div(class="wrapper wrapper-content", style="margin:0;padding:0")
                block content    

            .footer
                div.pull-right 10GB of 
                    strong 250GB 
                    | free.
                div
                    strong Copyright
                    Noke &copy; 20145-2016    

    <!-- Mainly scripts -->
    script(src="/js/jquery-2.1.1.js")
    script(src="/js/bootstrap.min.js")
    script(src="/js/plugins/metisMenu/jquery.metisMenu.js")
    script(src="/js/plugins/slimscroll/jquery.slimscroll.min.js")

    <!-- Custom and plugin javascript -->
    script(src="/js/inspinia.js")
    script(src="/js/plugins/pace/pace.min.js")

    script.
        $(function(){
            $('li').click(function(){
                console.log('ppp');
                get();
            });
            new fformmenu();
        });

        var fformmenu = function(){
            this.init = function(){
                
                var mhtml = bind(this.menus, 1, this.menuno);
                $('#side-menu').append(mhtml);
                $('#side-menu').metisMenu();
            };

            var bind = function(menus, level, menuno){
                var mhtml = '', len = menus.length;

                for(var i = 0; i < len; i++){
                    var m = menus[i], arrow = '', chtml = '', active = '', expend = '';

                    var icon = (m.icon) ? '<i class="fa fa-' + m.icon + '"></i>' : '';

                    if(menuno.toString().substr(0, (level * 4)) == m.no.toString()){
                        active = ' class="active"';
                        expend = ' in';
                    }
                    if(m.childs && m.childs.length > 0) {
                        arrow = '<span class="fa arrow"></span>';
                        chtml = '<ul class="nav nav-second-level collapse' + expend + '">' + bind(m.childs, (level + 1), menuno) + '</ul>';
                    }
                    if(level == 1)
                        mhtml += '<li' + active + '><a href="' + m.url + '">' + icon + '<span class="nav-label">' + m.label + '</span>' + arrow + '</a>' + chtml + '</li>';
                    else
                        mhtml += '<li' + active + '><a href="' + m.url + '">' + icon + m.label + arrow + '</a>' + chtml + '</li>';
                }
                return mhtml;
            }
            this.menuno = #{menusno};

            this.menus = [];
            this.menus.push({no:1001, label: '桌面', icon: 'link', url: '/', childs: []});
            this.menus.push({
                no:1002, 
                label: '销售管理', 
                icon: 'globe', 
                url: '#', 
                childs: [{no:10020001, label: '销售单维护', url: '/sale'}]
            });
            this.menus.push({
                no:1003, 
                label: '业务维护', 
                icon: 'globe',
                url: '#', 
                childs: [{no:10030001, label: '阶梯价格', url: '/home/freighttiered'}]
            });
            this.menus.push({no:1004, label: 'MarkDown', icon: 'code', url: '/home/editormd', childs: []});

            this.init();
        }

    block scripts
